from django.conf.urls import url
from django.contrib import admin
from rest_framework_jwt.views import obtain_jwt_token
from . import views

# 子路由配置
urlpatterns = [
    # 发送验证码
    url(r'^sms_codes/(?P<mobile>1[3-9]\d{9})/$', views.SMSCodeView.as_view()),
    # 判断用户名是否存在
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.UsernameCountView.as_view()),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileCountView.as_view()),

    url(r'^users/$', views.UserView.as_view()),
    # url(r'^authorizations/$', obtain_jwt_token),  # 登陆代码没有重写之前使用
    url(r'^authorizations/$', views.UserAuthorizeView.as_view()),  # 代码重写之后使用
    url(r'^user/$', views.UserDetailView.as_view()),

    url(r'^emails/$', views.EmailView.as_view()),  #  设置邮箱路由
    url(r'^emails/verification/$', views.VerifyEmailView.as_view()),
    url(r'^browse_histories/$', views.AddUserBrowsingHistoryView.as_view()),
]